package com.domain;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

@PersistenceCapable
public class AppUser {
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key primaryKey;
	
	@Persistent
	private String userName;
	
	@Persistent
	private String userPassword;
	
	@Persistent
	private String userEmailAddress;
	
	@Persistent
	private Date registryDate;
	
	public AppUser(String userName, String userPassword, String userMailAddress, Date registryDate){
		this.userName = userName;
		this.userPassword = userPassword;
		this.userEmailAddress = userMailAddress;
		this.registryDate = registryDate;
	}

	public Key getPrimaryKey() {
		return primaryKey;
	}

	public void setPrimaryKey(Key primaryKey) {
		this.primaryKey = primaryKey;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getUserPassword() {
		return userPassword;
	}

	public void setUserPassword(String userPassword) {
		this.userPassword = userPassword;
	}

	public String getUserEmailAddress() {
		return userEmailAddress;
	}

	public void setUserEmailAddress(String userEmailAddress) {
		this.userEmailAddress = userEmailAddress;
	}

	public Date getRegistryDate() {
		return registryDate;
	}

	public void setRegistryDate(Date registryDate) {
		this.registryDate = registryDate;
	}
	
	@Override
	public String toString(){
		String userString = "";
		userString += "Username: " + getUserName() + "\n";
		userString += "Password: " + getUserPassword() + "\n";
		return userString;
	}
}
